<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>系统维护</title>
<jsp:include page="../inc.jsp"></jsp:include>
<script type="text/javascript">
	Ext.onReady(function(){
		createGrid();
		createLayout();
	});
	
	var gridEl = 'repTime-grid';
	var grid,form, selModel, toolbar,store,column;
	var win;
	
	function createGrid(){
		store = Ext.create('Ext.data.Store',{
	          fields : ['name', 'msg', 'success'],
	          proxy : {
	        	    type: 'ajax',
	                url : '../repairController/repair.action',
	                reader: {
	                    type: 'json',
	                    root: 'datas',
	                    totalProperty : 'totalCount'
	                }
	              },
					autoLoad: false
	        });
		
		grid = new Ext.grid.GridPanel({
	        region : 'center',
	        loadMask : {
	          msg : "正在初始化..."
	        },
	        region : 'center',
	        store : store,
	        columns : [{header : '信息',dataIndex : 'msg',width : 500},
                  {header : '状态',dataIndex : 'success',width : 300,
        		   renderer : function num(val) {
	   		          if (val) {
	   		            return '<span style="color:green;">成功</span>';
	   		          }
   		        	}
   		     	 }],
	        viewConfig : {
	          forceFit : true
	        }
	      });
	}
	
	// 刷新列表
	function reloadRecords() {
		grid.getStore().reload();
	}
	
	// 创建layout
	function createLayout() {
		toolbar = new Ext.Toolbar({
	          items : ['-',{
	                text : "系统升级更新",
	                id : "tlb_update",
	                handler : function() {
	                  grid.getStore().load();
	                }
	              }]
	        });
	
		var viewport = new Ext.Viewport({
			layout : 'border',
			items : [ {
				layout : 'fit',
				region : 'north',
				border : false,
				items : [ toolbar ]
			}, {
				layout : 'border',
				region : 'center',
				border : false,
				items : [ grid ]
			} ]
		});
	
		viewport.doLayout();
	}
	
</script>
</head>
<body>
</body>
</html>